<html>
<head><meta charset="utf-8"><title>do we have graphs/tables/something of cgu partitioning? · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html">do we have graphs/tables/something of cgu partitioning?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="198451769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198451769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198451769">(May 22 2020 at 15:03)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> I was thinking during the meeting -- to what extent would it be helpful to have some visualization (at least a set of bullet-y lists) of the CGUs we ended up with and how we got there?</p>



<a name="198451780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198451780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198451780">(May 22 2020 at 15:03)</a>:</h4>
<p>Do we dump this somehow today?</p>



<a name="198451814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198451814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198451814">(May 22 2020 at 15:03)</a>:</h4>
<p>Like, has anyone looked at the CGUs for say serde and said "hm these make sense"</p>



<a name="198451878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198451878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198451878">(May 22 2020 at 15:04)</a>:</h4>
<p><code>-Z print-mono-items={lazy,eager}</code> prints the mono-items and the cgu(s) that they're in, IIRC</p>



<a name="198452093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452093">(May 22 2020 at 15:06)</a>:</h4>
<p>I assume the print out is not in a format usable by graphviz though?</p>



<a name="198452142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452142">(May 22 2020 at 15:06)</a>:</h4>
<p>I think having visualizations at hand would help a ton. Maybe we could show these from the perf runs reports. Like, having a button that pops up the visualization for this or that particular run?</p>



<a name="198452168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452168">(May 22 2020 at 15:06)</a>:</h4>
<p>not sure how much that would help/hinder analysis, but it seems worth considering</p>



<a name="198452172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452172">(May 22 2020 at 15:06)</a>:</h4>
<p>yes, I ask this primarily to gauge whether they'd be useful for perf</p>



<a name="198452183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452183">(May 22 2020 at 15:06)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116083">pnkfelix</span> <a href="#narrow/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F/near/198452093">said</a>:</p>
<blockquote>
<p>I assume the print out is not in a format usable by graphviz though?</p>
</blockquote>
<p>no, but all the information we'd need is there though, I think</p>



<a name="198452249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452249">(May 22 2020 at 15:07)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@davidtwco</span> I don't think they show the merging strategy, or maybe I'm not seeing it</p>



<a name="198452293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452293">(May 22 2020 at 15:07)</a>:</h4>
<p>basically what I was thinking is sort of a "tree" where the initial set is at the bottom collapsing to ~16 at the top if that makes sense</p>



<a name="198452325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452325">(May 22 2020 at 15:07)</a>:</h4>
<p>Maybe we could dump detailed reports with a flag? Like... "here's how we started, and this is how it looked after each merging"</p>



<a name="198452372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452372">(May 22 2020 at 15:08)</a>:</h4>
<p>Oh, you're right - it wouldn't give you that - it would just tell you where things ended up; misread the initial message.</p>



<a name="198452387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452387">(May 22 2020 at 15:08)</a>:</h4>
<p>Yes, exactly what simulacrum said!</p>



<a name="198452400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452400">(May 22 2020 at 15:08)</a>:</h4>
<p>I think the end state is useful, but I imagine that the way there is also pretty key to understanding the decisions made</p>



<a name="198452440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452440">(May 22 2020 at 15:08)</a>:</h4>
<p>And to potentially spot weaknesses in the current scheme</p>



<a name="198452520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452520">(May 22 2020 at 15:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116107">davidtwco</span> <a href="#narrow/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F/near/198451878">said</a>:</p>
<blockquote>
<p><code>-Z print-mono-items={lazy,eager}</code> prints the mono-items and the cgu(s) that they're in, IIRC</p>
</blockquote>
<p>Oh, that's super useful! I've been using <code>RUSTC_LOG=rustc_mir::monomorphize::partitioning</code> which prints out similar data at each step of the algorithm.</p>



<a name="198452863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198452863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198452863">(May 22 2020 at 15:11)</a>:</h4>
<p>the output looks like the following, for anyone who's interested and can't check:</p>
<div class="codehilite"><pre><span></span><code>MONO_ITEM fn alloc::alloc[0]::alloc[0] @@ 1nzjqubjkxlft6bh[External]
MONO_ITEM fn alloc::alloc[0]::alloc_zeroed[0] @@ 1nzjqubjkxlft6bh[Internal]
</code></pre></div>



<a name="198453104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198453104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198453104">(May 22 2020 at 15:12)</a>:</h4>
<p>anyway, <span class="user-mention" data-user-id="125250">@Wesley Wiser</span> do you think exposing even just the raw dumps in perf somehow would be helpful?</p>



<a name="198453280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198453280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198453280">(May 22 2020 at 15:14)</a>:</h4>
<p>I would love that honestly</p>



<a name="198453296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198453296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198453296">(May 22 2020 at 15:14)</a>:</h4>
<p>Just getting the data out of rustc to look at isn't trivial</p>



<a name="198453308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198453308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198453308">(May 22 2020 at 15:14)</a>:</h4>
<p>Although <span class="user-mention" data-user-id="116107">@davidtwco</span>'s flag should help quite a bit</p>



<a name="198453361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198453361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198453361">(May 22 2020 at 15:15)</a>:</h4>
<p>The other thing I ended up doing was dumping the log output to a file and then using a graphical diff tool on it between runs</p>



<a name="198453378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198453378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198453378">(May 22 2020 at 15:15)</a>:</h4>
<p>(especially in the incremental test case)</p>



<a name="198453438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/do%20we%20have%20graphs/tables/something%20of%20cgu%20partitioning%3F/near/198453438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/do.20we.20have.20graphs.2Ftables.2Fsomething.20of.20cgu.20partitioning.3F.html#198453438">(May 22 2020 at 15:15)</a>:</h4>
<p>I've got the output of those flags for servo-script with and without polymorphisation in debug and release to try look into, not gotten to doing it yet.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>